import cn.zgr.ssm.entity.StudentVO;
import cn.zgr.ssm.mapper.StudentMapper;
import cn.zgr.ssm.service.IStudentService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;
import java.util.SortedMap;

public class StudnetServiceCase {

    public AbstractApplicationContext ac;
    public IStudentService studentServiceImpl;

    @Test
    public void getStudentVOList(){
        List<StudentVO> list = studentServiceImpl.showStudentVOList();
        for(StudentVO s : list){
            System.out.println(s);
        }
    }

    @Before
    public void doBefore(){
        ac = new ClassPathXmlApplicationContext("applicationContent.xml");
        System.out.println(ac);
        studentServiceImpl = ac.getBean("studentServiceImpl", IStudentService.class);
    }

    @After
    public void doAfter(){
        ac.close();
    }
}
